import Vue from "vue";
import App from "./App";
import i18n from "./i18n";
import axios from "axios";
import ElementUI from "element-ui";

import VueRouter from 'vue-router';
import routes from './router/index';
import store from "./store";
import { baseURL } from "./config/env";
import "element-ui/lib/theme-default/index.css"; // 默认主题
// import '../static/css/theme-green/index.css';       // 浅绿色主题
import "babel-polyfill";

Vue.use(ElementUI);
Vue.use(VueRouter);

const router = new VueRouter({
    routes
})
/*router.beforeEach((to, from, next) => {

    if (to.path != '/login') {
        next({ path: '/login' })
    } else {
        next()
    }
})*/
axios.defaults.baseURL = baseURL;
Vue.prototype.$axios = axios;
new Vue({
    i18n,
    store,
    router,
    ...App,
}).$mount('#app');
